<template>
	<view>
		<view class="cu-bar bg-white solid-bottom">
			<view class="action">
				消息列表
			</view>
			<view class="action" @click="yidu">
				<text>全部标记为已读</text>
			</view>
		</view>
		<block v-for="(item,index) in list" :key="index">
			<view class="cu-bar bg-white solid-bottom">
				<view class="action">
					<text v-if="item.status < 1" class="cuIcon-title text-red"></text>{{item.title}}
				</view>
			</view>
		</block>		
	</view>
</template>

<script>
	var that
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			that = this
			that.$u.post('index/message', {}).then(res => {
				that.list = res
			})
		},
		methods: {
			yidu(){
				that.$u.post('index/message', {op:'yidu'}).then(res => {
					that.$u.post('index/message', {}).then(res => {
						that.list = res
					})
				})
			}
		}
	}
</script>

<style>

</style>
